﻿<!--
Majesty of Omega - The next evolution of macro management space strategy

Copyright 2007 André Claaßen

This file is protected by the terms and conditions of the
Microsoft Community License (Ms-CL 1.1), a copy of which should
have been distributed along with this software. If not,
you may find the license information at the following URL:

http://www.microsoft.com/resources/sharedsource/licensingbasics/communitylicense.mspx
-->

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Majesty_of_Omega_Geometry="clr-namespace:Majesty_of_Omega.GUI.Geometry;assembly="
    xmlns:Majesty_of_Omega_Controls="clr-namespace:Majesty_of_Omega.GUI.Controls;assembly="
    xmlns:Majesty_Commands="clr-namespace:Majesty_of_Omega.GUI.Commands"
    x:Class="Majesty_of_Omega.GUI.Pages.Game.GalaxyPage"
    Loaded="OnLoaded" x:Name="page" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Foreground="#FF000000"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" d:DesignWidth="936.08" d:DesignHeight="572"
	xmlns:Controller="clr-namespace:Majesty_of_Omega.GUI.Controller"
	>
    <Page.Resources>
    	<Style x:Key="InfoTextStyle" TargetType="{x:Type TextBlock}">
    		<Setter Property="TextWrapping" Value="NoWrap"/>
    		<Setter Property="TextTrimming" Value="None"/>
			<Setter Property="HorizontalAlignment" Value="Left"/>
			<Setter Property="VerticalAlignment" Value="Center"/>
			<Setter Property="Margin" Value="14,8,0,8" />
			<Setter Property="Width" Value="Auto" />
			<Setter Property="FontFamily" Value="Zurich XBlk BT" />
			<Setter Property="FontWeight" Value="Bold" />
			<Setter Property="Foreground" Value="#FFFFFFFF" />
    	</Style>
		  <Style x:Key="GalaxyButtonStyle" TargetType="{x:Type Button}">
        <Setter Property="Template">
            <Setter.Value>
			    <ControlTemplate TargetType="{x:Type Button}">
			        <ControlTemplate.Resources>
			            <Storyboard x:Key="Timeline1">
			                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
			                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="1"/>
			                </DoubleAnimationUsingKeyFrames>
			            </Storyboard>
			            <Storyboard x:Key="Timeline2">
			                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="glow" Storyboard.TargetProperty="(UIElement.Opacity)">
			                    <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
			                </DoubleAnimationUsingKeyFrames>
			            </Storyboard>
			        </ControlTemplate.Resources>
			        <Border BorderBrush="#FFFFFFFF" BorderThickness="1,1,1,1" CornerRadius="6,6,0,0">
			        	<Border.Background>
			        		<SolidColorBrush Color="{DynamicResource TitleDeepBlueColor}"/>
			        	</Border.Background>
			            <Border x:Name="border" Background="#7F000000" BorderBrush="#FF000000" BorderThickness="1,1,1,1" CornerRadius="6,6,0,0">
			                <Grid>
			                    <Grid.RowDefinitions>
			                        <RowDefinition Height="0.507*"/>
			                        <RowDefinition Height="0.493*"/>
			                    </Grid.RowDefinitions>
			                    <Border Opacity="0" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Grid.RowSpan="2" CornerRadius="6,6,0,0">
			                        <Border.Background>
			                            <RadialGradientBrush>
			                                <RadialGradientBrush.RelativeTransform>
			                                    <TransformGroup>
			                                        <ScaleTransform ScaleX="1.702" ScaleY="2.243"/>
			                                        <SkewTransform AngleX="0" AngleY="0"/>
			                                        <RotateTransform Angle="0"/>
			                                        <TranslateTransform X="-0.368" Y="-0.152"/>
			                                    </TransformGroup>
			                                </RadialGradientBrush.RelativeTransform>
			                                <GradientStop Color="#B28DBDFF" Offset="0"/>
			                                <GradientStop Color="#008DBDFF" Offset="1"/>
			                            </RadialGradientBrush>
			                        </Border.Background>
			                    </Border>
			                    <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Grid.RowSpan="2"/>
			                    <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="shine" Width="Auto" CornerRadius="6,6,0,0">
			                        <Border.Background>
			                            <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
			                                <GradientStop Color="#99FFFFFF" Offset="0"/>
			                                <GradientStop Color="#33FFFFFF" Offset="1"/>
			                            </LinearGradientBrush>
			                        </Border.Background>
			                    </Border>
			                </Grid>
			            </Border>
			        </Border>
			        <ControlTemplate.Triggers>
			            <Trigger Property="IsPressed" Value="True">
			                <Setter Property="Opacity" TargetName="shine" Value="0.4"/>
			                <Setter Property="Background" TargetName="border" Value="#CC000000"/>
			                <Setter Property="Visibility" TargetName="glow" Value="Hidden"/>
			            </Trigger>
			            <Trigger Property="IsMouseOver" Value="True">
			                <Trigger.EnterActions>
			                    <BeginStoryboard Storyboard="{StaticResource Timeline1}"/>
			                </Trigger.EnterActions>
			                <Trigger.ExitActions>
			                    <BeginStoryboard x:Name="Timeline2_BeginStoryboard" Storyboard="{StaticResource Timeline2}"/>
			                </Trigger.ExitActions>
			            </Trigger>
			        </ControlTemplate.Triggers>
			    </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground" Value="#FFFFFFFF"/>
       </Style>
        <ObjectDataProvider x:Key="GalaxyPageControllerDS" ObjectType="{x:Type Controller:GalaxyPageController}" d:IsDataSource="True"/>
    </Page.Resources>
    <Page.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded"/>
    </Page.Triggers>
    <Page.CommandBindings>
        <CommandBinding Command="Majesty_Commands:MainCommands.InGameMenuCommand" Executed="OnGameMenu" />
        <CommandBinding Command="Majesty_Commands:MainCommands.CancelSubFrameCommand" Executed="OnCancelMenu" />
        <CommandBinding Command="Majesty_Commands:MainCommands.SaveGameCommand" Executed="OnSaveGame" />
        <CommandBinding Command="Majesty_Commands:MainCommands.ResearchScreenCommand" Executed="OnResearchScreenCommand" />
        <CommandBinding Command="Majesty_Commands:MainCommands.SituationReportCommand" Executed="OnSituationReportCommand" />
    </Page.CommandBindings>
    <Grid x:Name="LayoutRoot" DataContext="{Binding Mode=OneWay, Source={StaticResource GalaxyPageControllerDS}}" >
		<Grid.RowDefinitions>
			<RowDefinition Height="30"/>
			<RowDefinition Height="30"/>
			<RowDefinition Height="*"/>
			<RowDefinition Height="29.184"/>
		</Grid.RowDefinitions>
		<Grid Grid.Row="1" Grid.RowSpan="2">
    		<Canvas x:Name="CanvasGalaxy" Background="Black">
    			<Viewport3D x:Name="ViewportGalaxy" Width="{Binding Path=ActualWidth, ElementName=CanvasGalaxy}" Height="{Binding Path=ActualHeight, ElementName=CanvasGalaxy}" ClipToBounds="True">
    				<!-- Defines the camera used to view the 3D object. -->
    				<Viewport3D.Camera>
    					<PerspectiveCamera x:Name="Camera" FieldOfView="45"  Position="0,0,100" LookDirection="0,0,-100" Changed="OnCameraChanged"/>
    				</Viewport3D.Camera>

    				<!-- The ModelVisual3D children contain the 3D models -->
    				<!-- This ModelVisual3D defines the light cast in the scene. Without light, the 3D 
                   object cannot be seen. Also, the direction of the lights affect shadowing. If desired,
                   you can create multiple lights with different colors that shine from different directions. -->
    				<ModelVisual3D x:Name="GalaxyModel">
    					<ModelVisual3D.Transform>
    						<ScaleTransform3D  CenterX="0" CenterY="0" CenterZ="0" ScaleX="0.25" ScaleY="0.25" ScaleZ="0.25" />
    					</ModelVisual3D.Transform>
    					<ModelVisual3D>
    						<ModelVisual3D.Content>
    							<AmbientLight Color="#FFFFFFFF"/>
    						</ModelVisual3D.Content>
    					</ModelVisual3D>
    					<Majesty_of_Omega_Geometry:Galaxy3D x:Name="MyGalaxy3D"
    						Galaxy="{Binding Path=Galaxy, Mode=Default}"
    						LabelVisible="True"  ScaleAdjust="0.25"/>
    				</ModelVisual3D>
    			</Viewport3D>
    			<Majesty_of_Omega_Controls:StarPlanetCursor x:Name="StarCursor" Width="90" Height="90" Visibility="Hidden" />
    			<Border x:Name="StarInfoPanel" Background="{x:Null}" BorderThickness="2,2,2,2" Canvas.Left="330" Canvas.Top="51" BorderBrush="#FF24357F" Height="351" Visibility="Hidden">
    				<StackPanel Orientation="Vertical" Width="200" Height="400" Opacity="0.8" Background="#FF2F2F2F">
    					<TextBlock Opacity="1" x:Name="TitleText" Background="#FF000000" Foreground="#FFFFFFFF" Padding="4,3,0,7" FontWeight="Bold"><Run Language="de-de" Text="Innar"/><LineBreak/><Run Language="de-de" Text="F9 V (yellow-white-dwarf)"/></TextBlock>
    					<ListBox >
    						<ListBoxItem Content="ListBoxItem"/>
    						<ListBoxItem Content="ListBoxItem"/>
    					</ListBox>
    				</StackPanel>
    			</Border>
    		</Canvas>
    		<Border MouseLeftButtonUp="CaptureBorder_OnMouseLeftButtonUp" x:Name="CaptureBorder" Background="Transparent" />
    		<Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Opacity="0.495" Fill="#FF727272" x:Name="GreyRectangle" Visibility="Hidden" Margin="0,0,0,-30"/>
    		<Frame x:Name="GameMenuFrame" />
    	</Grid>
		<Grid x:Name="MenuGrid">
			<Grid.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FF3D3D3D" Offset="0"/>
					<GradientStop Color="#FF1A1A1A" Offset="1"/>
					<GradientStop Color="#FF020101" Offset="0.527"/>
				</LinearGradientBrush>
			</Grid.Background>
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.15*"/>
				<ColumnDefinition Width="0.308*"/>
				<ColumnDefinition Width="0.128*"/>
				<ColumnDefinition Width="0.296*"/>
				<ColumnDefinition Width="0.15*"/>
			</Grid.ColumnDefinitions>
			<Button Click="NextTurnButton_Click" Command="Majesty_Commands:MainCommands.InGameMenuCommand" Grid.Column="0" Content="Menu" x:Name="InGameMenuButton" Foreground="#FFFFFFFF" FontSize="14" Style="{DynamicResource GlassButtonStyle}"/>
			<Button Click="NextTurnButton_Click" Grid.Column="4" Content="Next Turn" x:Name="NextTurnButton" Foreground="#FFFFFFFF" FontSize="14" Style="{DynamicResource GlassButtonStyle}"/>
			<Grid Grid.Column="2">
				<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
					<TextBlock Style="{DynamicResource InfoTextStyle}"  Text="Time:" />
					<TextBlock Style="{DynamicResource InfoTextStyle}"  Text="{Binding Path=TurnNumberFormatted}"/>
				</StackPanel>
				<Rectangle HorizontalAlignment="Stretch" Width="Auto" Fill="#FFFFFFFF" Stroke="#FF000000" Opacity="0.115"/>
			</Grid>
		</Grid>
		<Grid HorizontalAlignment="Stretch"  Grid.Row="1" Background="{x:Null}" Opacity="1" x:Name="StatusIconsGrid">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="0.2*"/>
				<ColumnDefinition Width="0.2*"/>
				<ColumnDefinition Width="0.2*"/>
				<ColumnDefinition Width="0.2*"/>
				<ColumnDefinition Width="0.2*"/>
				<ColumnDefinition Width="0.2*"/>
				<ColumnDefinition Width="0.2*"/>
			</Grid.ColumnDefinitions>
			<Rectangle HorizontalAlignment="Stretch" Width="Auto" Fill="#FF004FC1" Stroke="{x:Null}" Grid.Column="0" Opacity="0.485" Grid.ColumnSpan="7"/>

			<StackPanel Orientation="Horizontal">
				<Image HorizontalAlignment="Left" x:Name="FoodProdImage" Width="Auto" Source="/Majesty_of_Omega_GUI;component/Graphics/UI/ico_plnts_foodprod.png" Margin="8,6,0,6" Height="Auto" Grid.Row="1"/>
				<TextBlock Style="{DynamicResource InfoTextStyle}" Text="100 / 50" />
			</StackPanel>

			<StackPanel Grid.Column="1" Orientation="Horizontal">
				<Image HorizontalAlignment="Left" Width="Auto" Source="/Majesty_of_Omega_GUI;component/Graphics/UI/ico_plnts_minprod.png" Margin="8,6,0,6" Height="Auto" Grid.Row="1"/>
				<TextBlock Style="{DynamicResource InfoTextStyle}" Text="2.5k / 743" />
			</StackPanel>

			<StackPanel Grid.Column="2" Orientation="Horizontal">
				<Image HorizontalAlignment="Left" Width="Auto" Source="/Majesty_of_Omega_GUI;component/Graphics/UI/ico_plnts_industry.png" Margin="8,6,0,6" Height="Auto" Grid.Row="1"/>
				<TextBlock Style="{DynamicResource InfoTextStyle}" Text="5.3k" />
			</StackPanel>

			<StackPanel Grid.Column="3" Orientation="Horizontal">
				<Image HorizontalAlignment="Left" Width="Auto" Source="/Majesty_of_Omega_GUI;component/Graphics/UI/Icon_productionpoints.png" Margin="8,6,0,6" Height="Auto" Grid.Row="1"/>
				<TextBlock Style="{DynamicResource InfoTextStyle}" Text="10.8k" />
			</StackPanel>

			<StackPanel Grid.Column="4" Orientation="Horizontal">
				<Image HorizontalAlignment="Left" Width="Auto" Source="/Majesty_of_Omega_GUI;component/Graphics/UI/Icon_researchpoints.png" Margin="8,6,0,6" Height="Auto" Grid.Row="1"/>
				<TextBlock Style="{DynamicResource InfoTextStyle}" Text="{Binding Path=ResearchPointsFormatted, Mode=Default}" x:Name="ResearchPoints" />
			</StackPanel>

			<StackPanel Grid.Column="5" Orientation="Horizontal">
				<Image HorizontalAlignment="Left" Width="Auto" Source="/Majesty_of_Omega_GUI;component/Graphics/UI/ico_plnts_stable2.png" Margin="8,6,0,6" Height="Auto" Grid.Row="1"/>
                <TextBlock Style="{DynamicResource InfoTextStyle}" Text="Content" />
			</StackPanel>
			
			<StackPanel Grid.Column="6" Orientation="Horizontal">
				<Image HorizontalAlignment="Left" Width="Auto" Source="/Majesty_of_Omega_GUI;component/Graphics/UI/ico_plnts_au.png" Margin="8,6,0,6" Height="Auto" Grid.Row="1"/>
                <TextBlock Style="{DynamicResource InfoTextStyle}" Text="21.0k (+326)" />
			</StackPanel>
		</Grid>
		<UniformGrid HorizontalAlignment="Stretch" Width="Auto" Grid.Row="3" Rows="1">
			<UniformGrid.Background>
				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
					<GradientStop Color="#FF000000" Offset="0"/>
					<GradientStop Color="{DynamicResource PanelButtonBackgroundColor}" Offset="1"/>
				</LinearGradientBrush>
			</UniformGrid.Background>
			<Button Width="Auto" Height="Auto" Content="Government" Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="Research" Command="Majesty_Commands:MainCommands.ResearchScreenCommand"  Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="Halls of Power	" Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="Empire" Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="Foreign Office" Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="Planets" Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="Encyclopedia Galactica" Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="Situation Report" Command="Majesty_Commands:MainCommands.SituationReportCommand"  Style="{DynamicResource GalaxyButtonStyle}"/>
			<Button Width="Auto" Height="Auto" Content="War Department" Style="{DynamicResource GalaxyButtonStyle}"/>
		</UniformGrid>
	</Grid>
</Page>
